package cms.common.data;

import lombok.ToString;

/**
 * 基类
 */
@ToString
public enum ApiResultCode implements ResultCode<ApiResultCode> {
    SUCCESS(0, "成功"),
    FAILURE(1, "业务处理失败"),
    DUPLICATE_ERROR(11, "操作重复"),
    DATA_EMPTY(12, "数据为空"),
    DB_ERROR(13, "数据库错误"),
    PARAM_NULL(14, "参数为空"),
    PARAM_ERROR(15, "参数错误"),
    NO_LOGIN_SUCCESS(16,  "用户没登陆"),
    NO_PERMISSION(17,"权限不足"),
    SYSTEM_ERROR(9999, "系统异常"),

    //注册模块
    RE_INPUT_CAPTCHA (3003,"请重新输入验证码"),
    ERR_INPUT_CAPTCHA (3004,"验证码输入错误"),
    EMPTY_INPUT_PASSWORD(3005, "密码不能为空" ),
    EMAIL_INPUT_USED(3006,"邮箱已注册" ),
    MOBILE_INPUT_USED(3007, "电话号码重复"),
    NICKNAME_INPUT_USED(3008,"公司名称已注册" ),
    EMPTY_INPUT_USERNAME(3009,"用户名不能为空"),
    ERR_INPUT_LOGIN(3010,"用户名与密码不匹配"),
    WAIT_INPUT_STATE(3021,"账号审核中"),
    REJECT_INPUT_STATE(3022,"账号审核不通过"),

    NOT_ENOUGH_STOCK(3023,"商品库存不足"),
    ERR_SKU_STACK(3024,"商品状态不合法"),
    EMPTY_SKU_INFO(3025,"商品不存在"),
    CART_CHECK_NOT_PASS(3026,"购物车校验失败");

    private int code;
    private String message;

    ApiResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return this.code;
    }

    public ApiResultCode setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMessage() {
        return this.message;
    }

    public ApiResultCode setMessage(String message) {
        this.message = message;
        return this;
    }

}
